package com.xuecheng.ucenter.feignclient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * ClassName: CheckCodeClientFallbackFactory
 * Package: com.xuecheng.ucenter.feignclient
 * Description:
 *
 * @Author Endeavor-ZQB
 * @Create 2023/2/16 11:30
 * @Version 1.0
 */
@Slf4j
@Component
public class CheckCodeClientFallbackFactory implements FallbackFactory<CheckCodeClient> {
    @Override
    public CheckCodeClient create(Throwable throwable) {
        return new CheckCodeClient() {
            @Override
            public Boolean verify(String key, String code) {
                throwable.getStackTrace();
                log.debug("远程调用验证码服务时，熔断异常:{}",throwable.getMessage());
                return null;
            }
        };
    }
}
